home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-26 | 851 b | 45 lines | [TEXT/TCEd] |
- #
- # ShowLine
- #
- # Last Modified: Friday, June 27, 1991 at 11:46 PM
- # Macro Files for Preditor
- #
- # Show a specific line in a file. Uses the current selection
- # from the file ~1 as input - and expects the format to be:
- #
- # File "hello.c"; Line 100 # Comment
- #
- # This macro is mainly used to execute Preditor and MPW
- # error statements.
- #
- # © Copyright Evatac Software 1988-1991
- # All rights reserved
- #
-
- /* First, get the file name/path name */
-
- Select([§]≤0, ~1)
- Search("", "File ", NULL, ~1)
- Select([§]≥0, ~1)
- Search("p", "[^\\"]*", NULL, ~1)
- filename = Select(§, ~1)
-
- /* Get the line #, if any */
-
- If (Select([§]≥2:[§]≥1, ~1) == ";")
- Search("p", "[0-9]+", NULL, ~1)
- lineNumber = Select(§, ~1)
- Else
- lineNumber = 0
- End
-
- /* Open the file and scroll to the line number */
-
- Open(filename, "a")
- If (lineNumber != 0)
- Select(%lineNumber, ~Active)
- End
-
-
-
-